package com.clhbolg.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.clhbolg.model.dto.PhotoDTO;
import com.clhbolg.model.vo.request.ConditionVO;
import com.clhbolg.service.IPhotoAlbumService;
import com.ruoyi.common.core.domain.R;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author cailinhu
 * @Description TODO
 * @Date 2023/10/12 10:28
 * @Version 1.0
 */
@RestController()
@RequestMapping("/albums")
@Validated
@RequiredArgsConstructor
public class PhotoAlbumController {

    private final IPhotoAlbumService photoAlbumService;
    /**
     * 用户获取相片信息
     *
     * @param albumId
     * @return
     */
    @GetMapping("/{albumId}/photos")
    @SaIgnore
    public R userListPhoto(@PathVariable Integer albumId, ConditionVO conditionVO){

        PhotoDTO dto=photoAlbumService.selectPhotoByAlbum(albumId,conditionVO);

        return R.ok(dto);

    }
}
